/*
 * ExternalModel.java
 * 
 * Created on Aug 18, 2007, 8:45:28 PM
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.usixml.model.imports;

import org.usixml.model.Model;

/**
 *
 * @author htmfilho
 */
public abstract class ExternalModel implements Model {

    private String id;
    private String name;
    
    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public String toString() {
        return this.name;
    }
    
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || !(object instanceof Model)) return false;

        Model other = (Model)object;

        if (id == null) return false;

        return id.equals(other.getId());
    }
    
    public int hashCode() {
        if (id != null)
            return id.hashCode();
        else
            return super.hashCode();
    }
}